package heap;

public class App {
    public static void main(String[] args) {
        // 返回虚拟机试图使用的最大内存
       long maxMemory = Runtime.getRuntime().maxMemory();
       // 返回jvm的总内存
       long totalMemory = Runtime.getRuntime().totalMemory();

       System.out.println((maxMemory / (double) 1024 / 1024) + "MB");
       System.out.println((totalMemory / (double) 1024 / 1024) + "MB");
    }
}
